package com.eportal.gd;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Properties;



public class Conf {

	public static String port = "";
	public static String LOG_PATH="";
	public static String db_ip="";
	public static String db_sid = "";
	public static String db_user="";
	public static String db_pwd="";
	public static String gd_ip="";
	public static String gd_port="";
	public static String gd_user="";
	public static String gd_pwd="";
	public static String SMS_DK="";
	
	public static String userID = "2005126838";
	public static String userPassword = "198312";
	public static String operatorID = "00000006";
	
	public Conf(String path){
		File file = new File(path+"config");
		Properties prop = new Properties();
		try {
			FileInputStream is = new FileInputStream(file);
			prop.load(is);
			is.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		port = prop.getProperty("port");
		LOG_PATH = prop.getProperty("LOG_PATH");
		db_ip=prop.getProperty("DB_IP");
		db_sid = prop.getProperty("DB_SID");
		db_user=prop.getProperty("DB_USER");
		db_pwd=prop.getProperty("DB_PWD");
		gd_ip= prop.getProperty("GD_IP");
		gd_port= prop.getProperty("GD_PORT");
		gd_user= prop.getProperty("GD_USER");
		gd_pwd= prop.getProperty("GD_PWD");
		
		try {
			SMS_DK = new String (prop.getProperty("SMS_DK").getBytes("ISO-8859-1"),"GBK");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
